from selenium.webdriver.common.by import By

from common.base import Base


class GenerateOrdersSuccessPage(Base):
    # 订单支付成功之后的元素文本定位
    def search_success(self):
        content1 = self.find_element_text((By.XPATH, '//h6'))
        content2 = content1.split(':')
        return content2[0]

    # 支付成功之后返回首页
    def success_out(self):
        self.click((By.LINK_TEXT, '返回首页'))
